/*
moxl - Modular XML Library
Copyright (c) 2007, Malcolm Sparks

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
package moxl.dom.raw;

import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.UserDataHandler;

import moxl.dom.MoxlElement;
import moxl.dom.MoxlNodeVisitor;
import moxl.dom.Visitable;
import moxl.dom.mutable.MutableCharacterData;
import moxl.dom.visitor.support.CharacterDataVisitableSupport;
import moxl.raw.RawCharacterData;

public class RawBackedCharacterData implements MutableCharacterData, Visitable
{
	private final RawCharacterData data;

	private MoxlElement parent;

	private final CharacterDataVisitableSupport visitableSupport = CharacterDataVisitableSupport.getInstance();

	public RawBackedCharacterData(RawCharacterData data)
	{
		this.data = data;
	}

	public String getText()
	{
		return data.getText();
	}

	public boolean isWhitespace()
	{
		return data.isWhitespace();
	}

	public void accept(MoxlNodeVisitor visitor)
	{
		visitableSupport.accept(visitor, this);
	}

	public String getNodeName()
	{
		throw new UnsupportedOperationException("TODO");
	}

	public MoxlElement getParent()
	{
		return parent;
	}

	public void setParent(MoxlElement parent)
	{
		if (this.parent != null && parent != null)
		{
			throw new IllegalStateException("Node already has a parent, clear it first");
		}
		this.parent = parent;
	}

	public void appendData(String arg) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public void deleteData(int offset, int count) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public String getData() throws DOMException
    {
	    return data.getText();
    }

	public int getLength()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public void insertData(int offset, String arg) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public void replaceData(int offset, int count, String arg) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public void setData(String data) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public String substringData(int offset, int count) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Node appendChild(Node newChild) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Node cloneNode(boolean deep)
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public short compareDocumentPosition(Node other) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public NamedNodeMap getAttributes()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public String getBaseURI()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public NodeList getChildNodes()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Object getFeature(String feature, String version)
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Node getFirstChild()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Node getLastChild()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public String getLocalName()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public String getNamespaceURI()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Node getNextSibling()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public short getNodeType()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public String getNodeValue() throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Document getOwnerDocument()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Node getParentNode()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public String getPrefix()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Node getPreviousSibling()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public String getTextContent() throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Object getUserData(String key)
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public boolean hasAttributes()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public boolean hasChildNodes()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Node insertBefore(Node newChild, Node refChild) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public boolean isDefaultNamespace(String namespaceURI)
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public boolean isEqualNode(Node arg)
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public boolean isSameNode(Node other)
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public boolean isSupported(String feature, String version)
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public String lookupNamespaceURI(String prefix)
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public String lookupPrefix(String namespaceURI)
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public void normalize()
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Node removeChild(Node oldChild) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Node replaceChild(Node newChild, Node oldChild) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public void setNodeValue(String nodeValue) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public void setPrefix(String prefix) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public void setTextContent(String textContent) throws DOMException
    {
	    throw new UnsupportedOperationException("TODO");
    }

	public Object setUserData(String key, Object data, UserDataHandler handler)
    {
	    throw new UnsupportedOperationException("TODO");
    }

}
